package fox.framework.rpc.server.dispatcher;

import fox.framework.rpc.server.message.request.RpcServerRequest;
import fox.framework.rpc.server.message.response.RpcServerResponse;

/**
 * Rpc服务端分发器
 *
 * @author cuichao
 */
public interface RpcRequestDispatcher {

    /**
     * rpc请求分发
     *
     * @param request
     * @param response
     * @return
     */
    void dispatch(RpcServerRequest request, RpcServerResponse response);

    /**
     * 处理异常
     * @param response
     * @param throwable
     * @return
     */
    void processExceptionHandler(RpcServerResponse response,Throwable throwable);
}
